Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

processor: add WaitForReadyContext method #393

Merged

Conversation

tymeshifter
Copy link
Contributor

@tymeshifter tymeshifter commented Sep 15, 2022

Currently the only option to test for processor readines is WaitForReady method.
This method is blocking until processor is ready.

When processor is dealing with long initialization, this call becomes unresponsive for virtually indefinite time. This behaviour is deal breaker for monitoring calls that just want to check on the status of the processor and return in reasonable amount of time i.e. Kubernetes healthcheck.

This change adds context aware method WaitForReadyContext that has all the same checks with addition to context cancelation check. This allows it to return when context is canceled with the context reported error. If the error is not nil it indicates that processor is not ready.

Currently the only option to test for processor readines is
WaitForReady method.
This method is blocking until processor is ready.
When processor is dealing with long initialization, this call
becomes unresponsive for virtually indefinite time.
This behaviour is deal breaker for monitoring calls that just
want to check on the status of the processor and return in reasonable
amount of time i.e. Kubernetes healthcheck.

This change adds context aware method WaitForReadyContext
that has all the same checks with addition to context cancelation
check. This allows it to return when context is canceled with the
context reported error. If the error is not nil it indicates that
processor is not ready.
Copy link
Contributor

@frairon frairon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, thanks @tymeshifter for that!
Any more comments from @jomaresch or @kavinsk1 maybe? 😁

@frairon frairon merged commit afb2f01 into lovoo:master Sep 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants